package com.base.action;

import com.base.bean.Agentbase;
import com.base.service.AgentbaseService;
import com.common.util.PagerModel;
import com.core.ssh2.AbstractActionSupport;

public class AgentbaseManagerAction extends AbstractActionSupport {
	private static final long serialVersionUID = 6595701905729778092L;

	private AgentbaseService agentbaseService;
	
	private Agentbase agentbase;
	
	private long agentno = 0l;
	
	private PagerModel pm;
	
	@Override
	public String execute() throws Exception {
		return SUCCESS;
	}
	
	public String addAgentbase() throws Exception {
		agentbaseService.addAgentbase(agentbase);
		return SUCCESS;
	}
	
	public String showAgentlist() throws Exception {
		pm = agentbaseService.findAgentbaseForPager();
		return SUCCESS;
	}
	
	public String showAgentbase() throws Exception {
		agentbase = agentbaseService.findAgentbase(agentno);
		return SUCCESS;
	}
	
	public String delAgentbase() throws Exception {
		agentbaseService.removeAgentbase(agentno);
		return SUCCESS;
	}
	
	public String getAgentbaseForUpdate() throws Exception {
		agentbase = agentbaseService.findAgentbase(agentno);
		return SUCCESS;
	}
	
	public String updateAgentbase() throws Exception {
		agentbaseService.updateAgentbase(agentbase);
		return SUCCESS;
	}

	/**
	 * @return the agentbase
	 */
	public Agentbase getAgentbase() {
		return agentbase;
	}

	/**
	 * @param agentbase the agentbase to set
	 */
	public void setAgentbase(Agentbase agentbase) {
		this.agentbase = agentbase;
	}

	/**
	 * @return the agentbaseService
	 */
	public AgentbaseService getAgentbaseService() {
		return agentbaseService;
	}

	/**
	 * @param agentbaseService the agentbaseService to set
	 */
	public void setAgentbaseService(AgentbaseService agentbaseService) {
		this.agentbaseService = agentbaseService;
	}

	/**
	 * @return the agentno
	 */
	public long getAgentno() {
		return agentno;
	}

	/**
	 * @param agentno the agentno to set
	 */
	public void setAgentno(long agentno) {
		this.agentno = agentno;
	}

	/**
	 * @return the pm
	 */
	public PagerModel getPm() {
		return pm;
	}

	/**
	 * @param pm the pm to set
	 */
	public void setPm(PagerModel pm) {
		this.pm = pm;
	}
	
	
}
